package com.zcx.service;

import com.zcx.mapper.DaoMapper;
import com.zcx.pojo.dto.StudentCrouseDto;
import com.zcx.pojo.dto.Vertify;
import com.zcx.pojo.vo.ClazzVo;
import com.zcx.pojo.vo.CollegeVo;
import com.zcx.pojo.vo.StudentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class SpringServiceImpl implements SpringService {


    @Autowired
    DaoMapper daoMapper;

    @Override
    public boolean queryuser(Vertify vertify) {

        Vertify queryuser = daoMapper.queryuser(vertify);
        System.out.println(queryuser);
        if(queryuser == null){
            return false;
        }
        return true;
    }

    @Override
    public List<CollegeVo> querycalss() {
        return daoMapper.querycalss();
    }

    @Override
    public List<ClazzVo> querystudent(String clazzName) {
        return daoMapper.querystudent(clazzName);
    }

    @Override
    public List<StudentVo> queryperson(String num) {
        return daoMapper.queryperson(num);
    }

    @Override
    public boolean deleteperson(String num) {
        System.out.println(num);
        if(daoMapper.deleteperson(num)){
            return true;
        }
        return false;
    }

    @Override
    public int updateperson(StudentCrouseDto studentCrouseDto) {
        return daoMapper.updateperson(studentCrouseDto);
    }

    @Override
    public void querynumber() {
        daoMapper.querynumber();
    }

    @Override
    public void update() {
        daoMapper.update();
    }
}